package com.mooman219.gmail.server.handler;

import com.mooman219.gmail.server.annotation.EventHandler;
import com.mooman219.gmail.server.event.Listener;
import com.mooman219.gmail.server.event.core.TickEvent;
import com.mooman219.gmail.server.manager.network.SettingsManager;


public class TPSHandler implements Listener{
    public long lastAverage;

    public TPSHandler(){
        lastAverage = 0;
    }

    @EventHandler
    public void onTick(TickEvent e){
        lastAverage = (lastAverage + e.getDeltaTime()) / 2;
        SettingsManager.serverGUI.setTitle("AnotherServer TPS: " + lastAverage);
    }
}
